home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / Health Monitor 2.1 / HealthMonitor.msi / _A9A458837CEAFF9D55B2EAE342FFA8DF / _202FB0A022404E589F88A7EEA8A842D3 < prev    next >
Encoding:
Text File  |  2005-01-14  |  711 b   |  24 lines

  1. ' ***********************************************
  2. ' * CheckFolderSize.vbs                  *
  3. ' * By Vittorio Pavesi (www.vittorio.tk)    *
  4. ' *                        * 
  5. ' * Verify File System Size            *
  6. ' ***********************************************
  7.  
  8. 'BaseDirectory = "C:\MyFolder"
  9. Limit = 100  ' MB
  10.  
  11. CheckFolder BaseDirectory, Limit
  12.  
  13. Function CheckFolder(Directory, Limit)
  14.     Set sss = CreateObject("WScript.Shell")
  15.     Set fso = CreateObject("Scripting.FileSystemObject")
  16.     Set f = fso.GetFolder(Directory)
  17.        value = round(f.Size/1048576,2)
  18.     If value > limit Then
  19.         wscript.echo "Error: " & f.Name & " - " & Value & " Mb"
  20.     else
  21.         wscript.echo "OK: " & f.Name & " - " & Value & " Mb"
  22.     End If
  23. End Function
  24.